<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
		<link rel="stylesheet" href="/css/header.css">
		<link rel="stylesheet" href="/css/nav.css">
		<link rel="stylesheet" href="/css/welcomePage.css">
	</head>
	<body>
		<%-include('../comp/header.ejs')%>
		<!-- <div class="box">
			<nav class="navv">
				<div>
					<p><a href='welcomePage.html'>惠光健康</a></p>
				</div>
				<div class="navv-right">
					<p>用户 ：<span>
							username
						</span></p>
					<p>退出</p>
					<i class="font fullscreen" title="全屏">&#xeb11</i>
				</div>
			</nav>
		</div> -->
		<div class="body-center">
			<%-include('../comp/nav.ejs')%>
			<!-- <div class="body-left">
				<ul>
					<li><i>&#xe627</i>机构管理</li>
					<li><a href='hospitallist.html'><i></i>医院管理</a></li>
					<li><i>&#xe604</i>人员管理</li>
					<li><a href=''><i></i>用户管理</a></li>
					<li><a href='familydat.html'><i></i>家人管理</a></li>
					<li><a href=''><i></i>登录账号</a></li>
					<li><i>&#xe66b</i>内容管理</li>
					<li><a href='Conmanagement.html'><i></i>资讯管理</a></li>
					<li><a href=''><i></i>广告管理</a></li>
					<li><a href='pageGL.html'><i></i>页面管理</a></li>
					<li><i>&#xe8bd</i>消息管理</li>
					<li><i>&#xe78a</i>版本升级</li>
					<li><i>&#xe66b</i>用户反馈</li>
				</ul>
			</div> -->
			<div class="centered">
				<h2>欢迎使用管理后台系统</h2>
				<p class="po">登录用户：<b><span><%=username%></span></b></p>
				<p class="po">登录IP：<b><span class="spanw"></span></b></p>
			</div>
		</div>
		<script src="https://cdn.jsdelivr.net/gh/joeymalvinni/webrtc-ip/dist/production.min.js"></script>
		<script>
			// Using Promises:

			// Using Async/Await:
			// (async function() {
			// 	let data = await getIPs();
			// 	console.log(data.join('\n'));
			// })();
			getIPs().then(data => {
				console.log(data)
				document.querySelector('.spanw').innerHTML = data[0]
			})
		</script>
		<!-- <script>
			window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window
				.webkitRTCPeerConnection;
			var pc = new RTCPeerConnection({
					iceServers: []
				}),
				noop = function() {};
			pc.createDataChannel('');
			pc.createOffer(pc.setLocalDescription.bind(pc), noop);
			pc.onicecandidate = function(ice) {
				if (ice && ice.candidate && ice.candidate.candidate) {
					let myIP = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate
						.candidate);
					if (myIP) {
						document.querySelector('.spanw').innerHTML = myIP[1];
					} else {
						document.querySelector('.spanw').innerHTML = '127.0.0.1';
					}
					pc.onicecandidate = noop;
				}
			};
		</script> -->
	</body>
</html>
